<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <f:view>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Facturaci&oacute;n</title>
            <link type="text/css" href="../common/css/custom-theme-lefrog/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
            <!--<link type="text/css" href="../common/css/redmond/jquery-ui-1.8.23.custom.css" rel="stylesheet" />-->
            <link type="text/css" href="../common/css/administrar.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/ui.panel.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/interface-fisheye.css" rel="stylesheet" />           
            <!--<script type="text/javascript" src="../common/js/jquery-1.4.2.min.js"></script>-->
            <script type="text/javascript" src="../common/js/jquery-1.8.0.min.js"></script>
            <!--<script type="text/javascript" src="../common/js/jquery.ui.all.js"></script>-->
            <script type="text/javascript" src="../common/js/jquery.layout.js"></script>
            <!--<script type="text/javascript" src="../common/js/jquery-ui-1.8.6.custom.min.js"></script>-->
            <script type="text/javascript" src="../common/js/jquery-ui-1.8.23.custom.min.js"></script>
            <script type="text/javascript" src="../common/js/calendarioui-es.js"></script>          
            <script type="text/javascript" src="../common/js/facturacion.js"></script>
            <script type="text/javascript" src="../common/js/jquery.validate.js"></script>
            <script type="text/javascript" src="../common/js/messages_es.js"></script>
            <script type="text/javascript" src="../common/js/ui.panel.js"></script>
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script>        
            <script type="text/javascript" src="../common/js/interface.js"></script>          
            <script type="text/javascript" src="../common/js/jquery.pagination.js"></script>
            <script type="text/javascript" src="../common/js/jquery.contextMenu.js"></script>
            <link type="text/css" href="../common/css/jquery.contextMenu.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/pagination.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script>
            <link type="text/css" href="../common/css/jquery.timeentry.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery.tablesorter.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.metadata.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.pager.js"></script>
            <script type="text/javascript" src="../common/js/jquery.numeric.js"></script>
            <style type="text/css" title="currentStyle">
                @import "../common/css/demo_page.css";			
                @import "../common/css/demo_table_jui.css";
            </style>            
            <script type="text/javascript" src="../common/js/jquery.dataTables.js"></script>

            <!--<script type="text/javascript" src="../common/js/jquery.dateentry.js"></script>-->
            <!--<script type="text/javascript" src="../common/js/jquery.timeentry.js"></script>-->
            <!--<link type="text/css" href="../common/css/global.css" rel="stylesheet" />-->
            <link type="text/css" href="../common/css/jquery-ui-timepicker-addon.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery-ui-timepicker-addon.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-sliderAccess.js"></script>

            <script type="text/javascript">
                $(document).ready(
                function()
                {
                    $('#fisheye').Fisheye(
                    {
                        maxWidth: 120,
                        items: 'a',
                        itemsText: 'span',
                        container: '.fisheyeContainter',
                        itemWidth: 100,
                        proximity: 120,
                        halign : 'center'
                    }
                )
			
                }
            );

            </script>
            <style>
                #tab_estancia_ah { height: 400px; }
                #tab_estancia_au { height: 400px; }
                .tabs-top { position: relative; }
                .tabs-top .ui-tabs-panel { height: 250px; overflow: auto; }
                .tabs-top .ui-tabs-nav { position: absolute !important; left: 0; bottom: 0; right:0; padding: 0 0.2em 0.2em 0; }
                .tabs-top .ui-tabs-nav li { margin-top: -2px !important; margin-bottom: 1px !important; border-top: none; border-bottom-width: 1px; }
                .ui-tabs-selected { margin-top: -3px !important; }
            </style>
        </head>
        <body>                                   
            <div id="jsf">
                <h:outputText id="login" value="#{loginBean.nombreUsuario}"></h:outputText>
                <h:form id="form_oc" style="display: none">
                    <h:inputText id="idUsuario" value="#{loginBean.usuarioActivo}"></h:inputText>
                </h:form>
            </div>

            <div id="fisheye" class="fisheye">
                <center>
                    <h1 style="color: gray">Facturaci&oacute;n de Servicios</h1>
                </center>

                <br />
                <div class="fisheyeContainter">
                    <a href="#" id="consulta_externa" class="fisheyeItem"><img src="../common/img/consulta_externa.png" width="50"/><span>Consulta Externa</span></a>
                    <a href="#" id="ambulatoria" class="fisheyeItem"><img src="../common/img/fisioterapia.png" width="50"/><span>Ambulatoria</span></a>			
                    <a href="#" id="pyp" class="fisheyeItem"><img src="../common/img/vacunacion.png" width="50"/><span>P y P</span></a>			
                    <a href="#" id="urgencias" class="fisheyeItem"><img src="../common/img/urgencias.png" width="50"/><span>Urgencias</span></a>			
                    <a href="#" id="hospitalizacion" class="fisheyeItem"><img src="../common/img/hospitalizacion.png" width="50"/><span>Hospitalizaci&oacute;n</span></a>                            

                </div>
            </div>

            <div style="display: none" id="pantalla-factura">
                <div style="width: 100%; text-align: center;">
                    <table width="100%">
                        <tr>
                            <td  class="ui-state-hover" align="left">    
                                Facturaci&oacute;n de servicios&nbsp;&nbsp;<b style="color:green;width: 230px" id="txt-servicio"></b>
                            </td>
                            <td class="ui-state-hover" align="right">
                                <button id="configBtn">Config</button>               
                            </td>
                            <td class="ui-state-hover" align="right">                            
                                <button id="ayudaBtn">Ayuda</button>               
                            </td>
                        </tr>
                    </table>          
                    <div class="tooltips"></div> 

                    <form id="form-factura">
                        <div id="panel1">
                            <h3> 
                                Datos del paciente
                            </h3>   
                            <table width="100%" cellpadding="0" cellspacing="0">
                                <tr>                            
                                    <td>
                                        Fecha
                                    </td>

                                    <td>
                                        Identificaci&oacute;n
                                    </td>

                                    <td>
                                        Nombre Completo
                                    </td>

                                    <td>
                                        Edad
                                    </td>

                                    <td>
                                        Sexo 
                                    </td>    

                                    <td>
                                        Regimen
                                    </td>

                                    <td>
                                        Nivel
                                    </td>

                                    <td>
                                        Afiliaci&oacute;n
                                    </td>                                                                       
                                    <td style="display: none">
                                        Tipo Poblac&oacute;on
                                    </td>
                                    <td style="display: none">
                                        Tipo Paciente
                                    </td>  
                                    <td style="display: none">
                                        Fecha Nacimiento
                                    </td>
                                </tr>   
                                <tr> 
                                    <td>
                                        <input type="text" size="7" id="fecfac" name="fecfac" value="" />    
                                    </td>  

                                    <td>
                                        <table>
                                            <tr>

                                                <td>
                                                    <input type="text" size="8" ondblclick="buscarPacienteCodigo()" maxlength="20" id="identificacion" name="identificacion" value=""/>
                                                    <input type="hidden" id="idpaciente" name="idpaciente" value="" />
                                                    <!--se sobreescribe con idcps-->
                                                    <input type="hidden" id="idcontrato" value="" />
                                                    <input type="hidden" id="idmanual" value="" />
                                                </td>

                                                <!--<td>
                                                    <select style="width: 120px" readonly ="true"  id="id_tipo_ide" name="id_tipo_ide" class="ui-widget-content"></select>
                                                </td>-->

                                                <td>                                        
                                                    <img src="../common/img/user_search.png"  onclick="buscarPacienteCodigo()" style="cursor: pointer" alt="buscarPaciente" />                                                    
                                                </td>

                                                <!--<td>
                                                    <img src="../common/img/edit-clear.png" onclick="clearPacientecodigo()" style="cursor: pointer" alt="Eliminar" /> 
                                                </td>-->
                                            </tr>
                                        </table>
                                    </td>
                                    <td>
                                        <input type="text" size="32" readonly="true" id="nombres" value="" />

                                    </td>
                                    <td>
                                        <input type="text" size="1" readonly="true" id="edad" value=""/>

                                    </td>
                                    <td>
                                        <input type="text" size="1" readonly="true" id="sexo" value=""/>
                                        <input type="hidden" id="idsexopac" name="idsexopac" value=""/>

                                    </td>
                                    <td>
                                        <input type="text" size="7" readonly="true" id="regimen" value=""/>                                      

                                    </td>

                                    <td>
                                        <input type="text" size="1" readonly="true" id="nivel" value=""/>

                                    </td>

                                    <td>
                                        <input type="text" size="5" readonly="true" id="tipoafiliado" value=""/>

                                    </td>

                                    <td style="display: none">
                                        <input type="text" size="1" readonly="true" id="tipoPoblacion" value=""/>

                                    </td>

                                    <td style="display: none">
                                        <input type="text" size="1" readonly="true" id="tipoPaciente" value=""/>
                                    </td>

                                    <td style="display: none">
                                        <input type="text" size="10" readonly="true" maxlength="20" id="fecnac" value=""/>

                                    </td>
                                </tr>

                                <tr>
                                    <td colspan="2">
                                        Administradora
                                    </td>

                                    <td colspan="4">
                                        Contratos Disponibles
                                    </td>

                                    <td colspan="2">
                                        Tarifario
                                    </td> 

                                </tr>

                                <tr>

                                    <td  style="display: none">
                                        <table>
                                            <tr>
                                                <td>                                          
                                                    <input type="hidden" readonly="true" id="idservicio" value=""/>
                                                </td>                                           
                                                <td>
                                                    <input type="hidden" id="copagoserv" value=""/>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td colspan="2" >
                                        <select style="width: 265px" id="identidad" name="identidad" class="text ui-widget-content"></select>
                                    </td>

                                    <td colspan="4">
                                        <select style="width: 580px" id="idcps" name="idcps" class="text ui-widget-content"></select>
                                    </td>

                                    <td colspan="2">
                                        <input type="text" size="10" readonly="true" id="tarifario" value=""/>
                                    </td>         

                                    <td>
                                        <table>
                                            <tr>

                                                <td>
                                                    <!--
                                                    <img src="../common/img/medico.png" onclick="buscadorMedicos()" style="cursor: pointer" />
                                                    <img src="../common/img/edit-clear.png" onclick="clearMedico()" style="cursor: pointer" alt="Eliminar" />
                                                    -->
                                                    <!--<input type="hidden" id="idmedico" value=""/>-->
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </div>

                        <!--para el panel de servicios de pyp-->
                        <div id="panel5">
                            <h4>Programa / Grupo Servicios</h4>
                            <table width="100%" cellpadding="0" cellspacing="0">

                                <tr>
                                    <td> 
                                        Programa
                                    </td>

                                    <td>
                                        Grupo Servicio
                                    </td>
                                </tr>

                                <tr>
                                    <td>
                                        <!--
                                       <input type="text" ondblclick="buscadorMedicos()" readonly="true" size="40" maxlength="40" id="medico" value=""/>
                                        -->
                                        <select style="width: 640px" id="idprogramadepyp" name="idprograma" class="text ui-widget-content"></select>
                                    </td>

                                    <td>

                                        <select style="width: 340px" id="idgrupo" name="idgrupo" class="text ui-widget-content"></select>
                                    </td>
                                </tr>

                            </table>
                        </div>

                        <!--fin del panelservicios pyp-->

                        <div id="panel3">
                            <h4>Servicios (APIs)</h4>

                            <table width="100%" cellpadding="0" cellspacing="0">

                                <tr>
                                    <td>
                                        M&eacute;dico
                                    </td>

                                    <td>
                                        C&oacute;digo
                                    </td>
                                    <td colspan="2">
                                        Descripci&oacute;n
                                    </td>
                                    <td>
                                        Cant
                                    </td>
                                    <td>
                                        Valor
                                    </td>
                                </tr>

                                <tr>
                                    <td>
                                        <!--
                                       <input type="text" ondblclick="buscadorMedicos()" readonly="true" size="40" maxlength="40" id="medico" value=""/>
                                        -->
                                        <select style="width: 260px" id="idmedico" name="idmedico" class="text ui-widget-content"></select>
                                    </td>
                                    <td>
                                        <table>
                                            <tr>
                                                <td>
                                                    <!--<input type="text" size="10" onblur="buscarActividadCodigo()" maxlength="20" id="codact" value=""/>-->  
                                                    <!-- <input type="text" size="10" ondblclick="/*buscarActividadCodigo()*/" maxlength="20" id="codact" value=""/>-->
                                                    <input type="text" size="9" ondblclick="buscarActividadCodigo()" maxlength="20" id="codact" value=""/>
                                                </td>
                                                <td>
                                                    <img src="../common/img/case.png" onclick="buscarActividadCodigo()" style="cursor: pointer" styleClass="icon" />
                                                    <!--<img src="../common/img/edit-clear.png" onclick="clearActividadcodigo()" style="cursor: pointer" styleClass="icon" alt="Eliminar" />-->
                                                    <input type="hidden" id="idact" name="idact" value=""/>
                                                    <input type="hidden" id="grupoact" value=""/>
                                                    <input type="hidden" id="tiporegact" name="tiporegact" value=""/>

                                                    <input type="hidden" id="idsexoact" name="idsexoactividad" value="" />
                                                    <input type="hidden" id="idprogramaact" name="idprogramaactividad" value="" />                                                    
                                                    <input type="hidden" id="idfincnact" name="idfincnact" value="" />
                                                    <input type="hidden" id="idfinpxact" name="idfinpxact" value="" />
                                                    <input type="hidden" id="iddiagact" name="iddiagact" value="" />
                                                    <input type="hidden" id="idcantsesact" name="idcantsesion" value="" />
                                                    <!--<input type="hidden" id="ishabilact" name="ishabilact" value="" />-->
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td colspan="2">
                                        <input type="text" size="35" readonly="true" id="desact" value=""/>
                                    </td>
                                    <td>
                                        <input type="text" size="1"  id="cant" value="1"/>
                                    </td>

                                    <td>
                                        <input type="text" size="6" readonly="true" id="valor" value=""/>
                                    </td>

                                    <td>
                                        <img src="../common/img/user_edit.png" onclick="agregarActividadIndividual()" style="cursor: pointer" />
                                    </td>
                                    <!--<td>

                                        <button id="btnAgreAct" onclick="agregarActividad()" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
                                            <img src="../common/img/addapi.png" style="cursor: pointer" />
                                        </button>
                                    </td>-->
                                </tr>
                            </table>
                        </div>
                    </form>
                    <div id="camposOcultosValidacion" style="display: none">
                        <input type="hidden" id="idadmision" value="0"/>
                        <input type="hidden" id="iddetalleadmision" value="0"/>
                        <input type="hidden" id="espyp" value="0"/>
                        <input type="hidden" id="idplaneacionpyp" value="0"/>
                        <input type="hidden" id="idCita" value="0"/>
                    </div>
                    <!--<center>
                        <button id="btnAgreAct" onclick="agregarActividadIndividual()" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
                            <img src="../common/img/addapi.png" style="cursor: pointer" />
                        </button>
                    </center>-->
                    <div id="panel4">
                        <!--<h4>Servicios Seleccionados</h4>-->

                        <table align="right" border="1" id="res"  width="100%">
                            <tr class="ui-state-hover">
                                <th style="display: none" width="25px">No.</th>
                                <th width="50px">C&oacute;digo</th>
                                <th width="600px">Descripci&oacute;n</th>
                                <th width="25px">Cant</th>
                                <th width="100px">V. Total</th>
                                <th width="100px">V. Entidad</th>
                                <th width="100px">V. Paciente</th>
                                <th>Eliminar</th>
                            </tr>
                        </table>
                    </div>
                    <div id="panel6">   
                        <table align="right" border="1" id="rez" class='ui-widget-header' width="100%">
                            <tr class ="ui-state-hover" align="center">
                                <td>T. Factura</td>
                                <td>T. Entidad</td>
                                <td>T. Paciente</td>
                                <td>T. Cuota</td>
                                <td>T. Neto</td>
                                <td>T. Descuento</td>
                                <td>T. Cancelar</td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td>
                                    <input type="text" id="total" value="0" size="10" readonly="true"/>
                                </td>
                                <td>
                                    <input type="text" id="totpaciente" value="0" size="10" readonly="true"/>
                                </td>
                                <td>
                                    <input type="text" id="totentidad" value="0" size="10" readonly="true"/>
                                </td>
                                <td>
                                    <input type="text" id="totentidad" value="0" size="10" readonly="true"/>
                                </td>                               
                                <td>
                                    <input type="text" id="totdescuento" value="0" size="10" readonly="true"/>
                                </td>
                                <td>
                                    <input type="text" id="totdescuento" value="0" size="10" readonly="true"/>
                                </td>
                                <td>
                                    <input type="text" id="totdescuento" value="0" size="10" readonly="true"/>
                                </td>
                                <td id="lblcontratopyp" style="display: none">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    &nbsp;&nbsp;
                                    Programa PYP
                                </td>
                                <td class="ui-widget-content" id="programa"  style="display: none">
                                </td>
                            </tr>
                        </table>
                    </div>
                    <!--<div id="panel5">

                        <table  border="1" class="ui-state-hover">
                            <tr class="text">
                                <td>T. Factura</td>
                                <td>T. Entidad</td>
                                <td>T. Paciente</td>
                                <td>T. Cuota</td>
                                <td>T. Neto</td>
                                <td>T. Descuento</td>
                                <td>T. Cancelar</td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td>
                                    <input type="text" id="total" value="0" size="11" readonly="true"/>
                                </td>

                                <td>
                                    <input type="text" id="totpaciente" value="0" size="11" readonly="true"/>
                                </td>
                                
                                <td>
                                    <input type="text" id="totentidad" value="0" size="11" readonly="true"/>
                                </td>
                               
                                <td>
                                    <input type="text" id="totentidad" value="0" size="11" readonly="true"/>
                                </td>                               
                                
                                <td>
                                    <input type="text" id="totdescuento" value="0" size="11" readonly="true"/>
                                </td>
                                
                                <td>
                                    <input type="text" id="totdescuento" value="0" size="11" readonly="true"/>
                                </td>
                                
                                
                                <td>
                                    <input type="text" id="totdescuento" value="0" size="11" readonly="true"/>
                                </td>
                                

                                <td id="lblcontratopyp" style="display: none">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    &nbsp;&nbsp;
                                    Programa PYP
                                </td>
                                <td class="ui-widget-content" id="programa"  style="display: none">
                                </td>

                            </tr>
                        </table>

                    </div>-->
                </div>
                <center>
                    <!---->
                    <button id="grabarBtn" onclick="abrirDialogoLiquidarFactura()"> Grabar</button>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <!--<button id="liquidarBtn" onclick="abrirdialogoRips()"> Liquidar</button>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                    <!-- esperar para liquidar la factura, despues de los descuentos realizados.
                    <button id="liquidarBtn" onclick="enviarDatosBd()"> Liquidar</button>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                    <button id="cancelarBtn" onclick="cancelarFactura()"> Cancelar</button>  
                </center>
            </div>
            <!--BUSCADORES-->
            <!--Buscar Actividades-->
            <div id="dialogoBuscarActividad" style="display: none" title="ACTIVIDADES">
                <br />
                <div id="busquedaDiv">
                    <table width="100%">
                        <tr class="ui-widget-header">
                            <td>C&oacute;digo</td>
                            <td>
                                <input type="text" onkeyup="this.value=this.value.toUpperCase()" id="codigoBusq" size="16" maxlength="16"/>
                            </td>
                            <td>Descripci&oacute;n</td>
                            <td>
                                <input type="text" onkeyup="this.value=this.value.toUpperCase()" id="descBusq" size="45" maxlength="45"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" align="center">
                                <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"  id="buscar" type="button" value="Buscar"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="datos" style="display: none">
                </div>
            </div>
            <!--Buscar Pacientes-->
            <div id="dialogoBuscarPac" style="display: none" title="PACIENTES">
                <div id="busquedaDivPac">
                    <table width="100%">
                        <!--<tr class="ui-widget-header">
                            <td>
                                Identificaci&oacute;n
                            </td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr class="ui-widget-header">                    
                            <td>
                                <input onkeyup="validarBusquedaPac(1)" type="text" id="ide" size="16" maxlength="16"/>
                            </td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>-->
                        <tr class="ui-widget-header">
                            <td>Identificaci&oacute;n</td>
                            <td>Primer Nombre</td>
                            <td>Segundo Nombre</td>
                            <td>Primer Apellido</td>
                            <td>Segundo Apellido</td>
                        </tr>
                        <tr>  
                            <td>
                                <input onkeyup="validarBusquedaPac(1)" type="text" id="ide" size="8" maxlength="16"/>
                            </td>
                            <td>
                                <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="n1" size="12" maxlength="20"/>
                            </td>
                            <td>
                                <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="n2" size="12" maxlength="20"/>
                            </td>
                            <td>
                                <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="a1" size="12" maxlength="20"/>
                            </td>
                            <td>
                                <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="a2" size="12" maxlength="20"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="5" align="center">
                                <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" id="buscarPac" type="button" value="Buscar"/>
                            </td>
                        </tr>
                    </table>
                </div>

                <div id="datosPac" style="display: none">
                </div>
            </div>
            <div id="acttemp" style="display: none">
                <input type="text" id="vrempresatmp" value="0"/>
                <input type="text" id="vrpacientetmp" value="0"/>  
                <input type="text" id="idusuario" value="1"/>
                <input type="text" id="idprestador" value="1"/>
            </div>
            <!--Buscar Servicio Ubicacion-->
            <div id="dialogoBuscarServ" style="display: none" title="SERVICIOS">
                <br />
                <div id="busquedaDivServ">
                    <table>
                        <tr>
                            <td>C&oacute;digo</td>
                            <td>
                                <input type="text" id="codigoBusqServ" size="2" maxlength="2"/>
                            </td>
                            <td>Descripci&oacute;n</td>
                            <td>
                                <input type="text" id="descBusqServ" size="25" maxlength="25"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="datosServ" style="display: none">
                </div>
            </div>
            <!--Buscar Actividades  de PYP-->
            <div id="dialogoBuscarServPyp" style="display: none" title="SERVICIOS">
                <div style="width: 100%">
                    <div class="tooltips"></div>        
                    <div id="adm_actividadpyp">
                        <div style="width: 100%" id="buscador-form">
                            <table border="1" class="ui-widget-content" width="100">
                                <tr valign="middle" class="ui-widget-content">
                                    <td>C&oacute;digo</td>
                                    <td>Descripci&oacute;n</td>
                                    <td>Programa</td>
                                    <td><button id="buscarBtn">Buscar</button></td>
                                </tr>
                                <tr>
                                    <td><input type="text" size="8" onkeyup="this.value=this.value.toUpperCase()" id="buscarCod"/></td>
                                    <td><input type="text" size="34" onkeyup="this.value=this.value.toUpperCase()" maxlength="100" id="buscarDes"/></td>
                                    <td>
                                        <select id="id_progpyp" name="id_progpyp" style="width: 200px" class="text ui-widget-content"></select>
                                    </td>
                                    <td><button id="clearBtn">Limpiar</button></td>
                                </tr>
                            </table>
                        </div>
                        <table width="100%" id="tabla-actividadpyp">
                            <thead>
                                <tr>
                                    <th>Seleccione</th>
                                    <th>C&oacute;digo</th>
                                    <th>Descripci&oacute;n</th>
                                    <!--<th class="{sorter: false}">Opciones</th>-->
                                </tr>
                            </thead>
                            <tbody id="tabla-actividadpyp-body">
                            </tbody>
                        </table>
                        <div id="pager" class="pager">
                            <form>
                                <table>
                                    <tr class="ui-widget-header">
                                        <td>
                                            <img src="../common/img/first1.png" class="first"/>
                                        </td>
                                        <td>
                                            <img src="../common/img/prev1.png" class="prev"/>
                                        </td>
                                        <td>
                                            <input type="text" size="8" class="pagedisplay text ui-widget-content ui-corner-all"/>
                                        </td>
                                        <td>
                                            <img src="../common/img/next1.png" class="next"/>
                                        </td>
                                        <td>
                                            <img src="../common/img/last1.png" class="last"/>
                                        </td>
                                        <td>
                                            <select class="pagesize text ui-widget-content">
                                                <option selected="selected"  value="10">10</option>
                                                <option value="20">20</option>
                                                <option value="30">30</option>
                                                <option  value="40">40</option>
                                            </select>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </div>                
                    </div>
                </div>
            </div>
            <!--ACTIVIDADES DE CONSULTA-->
            <div id="dialogoBuscarConsulta" style="display: none" title="CONSULTAS">        
                <select style="width: 230px" id="idconsulta" name="idconsulta" class="text ui-widget-content"></select>
            </div>
            <!--Buscar Servicio Medico-->
            <div id="dialogoBuscarMed" style="display: none" title="MEDICOS">

                <div id="busquedaDivMed">
                    <table>
                        <tr>
                            <td>Identificaci&oacute;n</td>
                            <td>Nombre</td>
                        </tr>
                        <tr>
                            <td>
                                <input type="text" id="codigoBusqMed" size="20" maxlength="20"/>
                            </td>

                            <td>
                                <input type="text" id="descBusqMed" size="50" maxlength="50"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="datosMed" style="display: none">
                </div>
            </div>

            <!--dialogo liquidacion de factura-->
            <!--<div id="dialogoLiquidarFactura" style="display: none" title="LIQUIDACION DE FACTURA">

                <form id="frm-liq-fac">
                    <div id="panel-00">  

                        <table width="100%" class="ui-widget-content" border="1">
                            <tr class="ui-widget-header">                                    

                                <td>
                                    Fecha
                                </td>

                                <td>
                                    Identificaci&oacute;n
                                </td>

                                <td colspan="2">
                                    Nombre Completo
                                </td>
                            </tr>
                            <tr>   
                                <td>                                        
                                    <input size="13" type="text" id="fec_adm" />
                                </td>
                                <td>
                                    <input size="14" type="text" id="identificacion_adm" />
                                    <input type="hidden" id="idpaciente_adm" name="idpaciente_adm" value="" />
                                    <input type="hidden" id="idmanual_adm" value="" />

                                    <input type="hidden" id="id_entidad_adm" value="" />
                                    <input type="hidden" id="idcontrato_adm" value="" />
                                </td>
                                <td colspan="2">
                                    <input size="55" type="text" id="nombres_adm"/>
                                </td>
                            </tr>
                            <tr class="ui-widget-header">  
                                <td>
                                    Edad
                                </td>

                                <td>
                                    Sexo 
                                </td>    

                                <td>
                                    Regimen
                                </td>

                                <td>
                                    Nivel
                                </td>
                            </tr>
                            <tr>     
                                <td>                                        
                                    <input size="13" type="text" id="edad_adm" />
                                </td>

                                <td>
                                    <input size="14" type="text" id="sexo_adm" />
                                </td>
                                <td>                                        
                                    <input size="43" type="text" id="regimen_adm" />
                                </td>

                                <td>
                                    <input size="7" type="text" id="nivel_adm" />
                                </td>
                            </tr>     
                            <tr class="ui-widget-header"> 
                                <td colspan="4" align="center">
                                    Valores
                                </td>                                
                            </tr>
                            <tr class="ui-widget-header">
                                <td colspan="2">
                                    Facturado 
                                </td> 
                                <td colspan="2" align="right">                                    
                                    <input size="30" type="text" id="edad_adm" />
                                </td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td colspan="2">
                                    Copago
                                </td>
                                <td colspan="2" align="right">
                                    <input size="30" type="text" id="sexo_adm" />
                                </td>
                            </tr>   
                            <tr class="ui-widget-header">
                                <td colspan="2">
                                    Cuota Moderadora
                                </td>
                                <td colspan="2" align="right">                             
                                    <input size="30" type="text" id="regimen_adm" />
                                </td>  
                            </tr>  
                            <tr class="ui-widget-header">
                                <td colspan="2">
                                    Neto
                                </td>
                                <td colspan="2" align="right">                                      
                                    <input size="30" type="text" id="regimen_adm" />
                                </td>
                            </tr>    
                            <tr class="ui-widget-header">

                                <td colspan="2">
                                    Descuento
                                </td>
                                <td colspan="2" align="right">
                                    <input size="30" type="text" id="sexo_adm" />
                                </td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td colspan="2">
                                    Valor Usuario 
                                </td>
                                <td colspan="2" align="right">                                     
                                    <input size="30" type="text" id="edad_adm" />
                                </td>
                            </tr> 
                            <tr>
                                <td colspan="4" align="right">
                                    <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"  id="grabarFacturaBtn" type="button" value="Liquidar"/>  
                                </td>
                            </tr>
                        </table>           
                    </div>
                </form>
            </div>-->

            <!--dialogo rips-->
            <div id="dialogoRips" style="display: none" title="RIPS">
            </div>
            <!--dialogo confirmar rips-->
            <div id="dialogoConfirmaRips" style="display: none" title="Informacion">
                Desea ingresar el rips para la factura?
            </div>
            <!--dialogo confirmar CAJA-->
            <div id="dialogoConfirmaImpresion" style="display: none" title="Informacion">     
            </div> 
            <div id="citas-form" title="Info" style="display: none"></div>
            <!--DIALOGO CONFIGURACION-->
            <div id="dialogoConfiguracion" title="Configuracion" style="display: none">
            </div>


            <!--ACTIVIDADES DE LA ADMISION-->
            <div id="dialogoActividadesCargadasAdmision" style="display: none" title="ACTIVIDADES DE LA ADMISION">        
                <select style="width: 230px" id="idactix" name="idactix" class="text ui-widget-content"></select>
            </div>

            <!--DIALOGO ADMISION-->
            <div id="dialogoAdmision" style="display: none" title="Admision">              
                <form id="frm-adm-pac">
                    <div id="panel-000">                
                        <table width="100%" class="ui-widget-content" border="1">
                            <tr class="ui-widget-header">                                    
                                <td>Fecha</td>
                                <td>Identificaci&oacute;n</td>
                                <td colspan="2">Nombre Completo</td>
                            </tr>
                            <tr>  
                                <td>
                                    <input type="text" id="fec_adm" name="fec_adm" size="11" value=""/>
                                </td>
                                <td>
                                    <input type="text" id="identificacion_adm" name="identificacion_adm" size="11" value="" readonly="true" />
                                    <input type="hidden" id="idpaciente_adm" name="idpaciente_adm" value="" />
                                </td>
                                <td colspan="2">
                                    <input type="text" id="nombres_adm" name="nombres_adm" size="41" value="" readonly="true" />
                                </td>
                            </tr>
                            <tr class="ui-widget-header">  
                                <td>Edad</td>
                                <td>Sexo</td>    
                                <td>Regimen</td>
                                <td>Nivel</td>
                            </tr>
                            <tr>     
                                <td>
                                    <input type="text" id="edad_adm" name="edad_adm" size="11" value="" readonly="true" />
                                </td>
                                <td>
                                    <input type="text" id="sexo_adm" name="sexo_adm" size="11" value="" readonly="true" />
                                </td>
                                <td>                                        
                                    <input type="text" id="regimen_adm" name="regimen_adm" size="30" value="" readonly="true"/>
                                </td>
                                <td>
                                    <input type="text" id="nivel_adm" name="nivel_adm" size="7" value="" readonly="true" />
                                </td>
                            </tr>  
                            <tr class="ui-widget-header">  
                                <td colspan="2">
                                    Administradora
                                </td>
                                <td>
                                    Contratos Disponibles
                                </td>
                                <td>
                                    Autorizaci&oacute;n
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <select style="width: 300px" id="identidad_adm" name="identidad_adm" class="text ui-widget-content"></select>
                                    <input type="hidden" id="id_entidad_adm" value="" />
                                </td>
                                <td>
                                    <select style="width: 335px" id="idcps_adm" name="idcps_adm" class="text ui-widget-content"></select>
                                    <input type="hidden" id="idcontrato_adm" value="" />
                                </td>     
                                <td>
                                    <input type="text" size="7" id="autorizacion_adm" value="" />
                                </td>   
                            </tr>
                            <tr class="ui-widget-header ">                            

                                <td colspan="5">
                                    Via de Ingreso
                                </td>
                            </tr>
                            <tr>
                                <td colspan="5">
                                    <select style="width: 758px" id="idvia_adm" name="idvia_adm" class="text ui-widget-content"></select>                          
                                </td>
                            </tr>
                            <tr class="ui-widget-header">  

                                <td colspan="5">
                                    Causa Externa
                                </td>
                            </tr>
                            <tr>
                                <td colspan="5">
                                    <select style="width: 758px" id="id_causaex_adm" name="id_causaex_adm" class="text ui-widget-content"></select>
                                </td>                            
                            </tr>
                            <tr class="ui-widget-header"> 
                                <td colspan="5">
                                    Diagn&oacute;stico
                                </td>
                            </tr>
                            <tr>
                                <td colspan="5">
                                    <input type="hidden" size="72" name="idDx_adm" id="idDx_adm" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,17);" onblur="fill17();"  size="72" type="text" id="codDx_adm" ondblclick="this.value='';$('#idDx_adm').val('0')"/>                                                                        
                                    <div class="suggestionsBox" id="sug_dxing_adm" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxingList_adm">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>      
                            </tr>
                            <tr class="ui-widget-header">  

                                <td colspan="5">
                                    M&eacute;dico
                                </td>
                            </tr>                   
                            <tr>                
                                <td colspan="5">
                                    <select style="width: 758px" id="id_medico_adm" name="id_medico_adm" class="text ui-widget-content"></select>
                                </td>
                            </tr> 
                        </table>
                    </div>
                </form>
            </div>
            <!--DIALOGOS PARA LLENAR RIPS-->

            <!--DIALOGOS PARA LLENAR RIPS CONSULTA-->
            <div id="dialogoParaCapturarRipsConsulta" style="display: none" title="RIPS CONSULTA">
                <div id="panelParaCapturarRipsConsulta">
                    <form id="rips-cn">
                        <input type="hidden" id="iddetallecn" name="iddetallecn" value="0" />                   
                        <input type="hidden" id="valorcn" name="valorcn" value="0" />
                        <input type="hidden" id="valorcopagocn" name="valorcopagocn" value="0" />
                        <input type="hidden" id="valortotalcn" name="valortotalcn" value="0" />
                        <input type="hidden" id="band_rips" name="band_rips" value="0" />
                        <!--<input type="text" id="idfactura_ac" name="idfactura_ac"/>-->
                        <!-- <input type="hidden" id="cod_actividad" name="cod_actividad" value="0" />-->
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>C&oacute;digo</td>
                                <td>Descripci&oacute;n</td>
                            </tr>
                            <tr>
                                <td>
                                    <input size="20" type="text" id="codactripcn" name="codactripcn" readonly="true"/>
                                </td>

                                <td>
                                    <input size="55" type="text" id="desactripcn" readonly="true"/>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Fecha</td>
                                <td>Autorizacion</td>
                            </tr>
                            <tr>
                                <td>
                                    <input size="20" type="text" id="fecharipcn" name="fecharipcn" value="0" readonly="true"/>
                                </td>

                                <td>
                                    <input size="55" type="text" id="ordenripcn" name="ordenripcn" value="0" />
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Finalidad</td>
                                <td>Causa Externa</td>
                                <td>Tipo Diagn&oacute;stico</td>
                            </tr>
                            <tr>
                                <td>
                                    <select  style="width: 190px" class="text ui-widget-content" id="finalidadcn" name="finalidadcn" value=""></select>
                                </td>

                                <td>
                                    <select  style="width: 250px" class="text ui-widget-content" id="causaexcn" name="causaexcn" value=""></select>
                                </td>

                                <td>
                                    <select  style="width: 215px" class="text ui-widget-content" id="tipodxcn" name="tipodxcn" value=""></select>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Diagn&oacute;stico</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxpalcn" id="id_dxpalcn" value="0" class="ui-widget-content" />
                                    <input type="hidden" size="30" name="cd_dxpalcn" id="cd_dxpalcn" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,1);" onblur="fill1();" size="79" type="text" id="dxpalcn" name="dxpalcn" ondblclick="this.value='';$('#id_dxpalcn').val('')" />
                                    <div class="suggestionsBox" id="sug_dxpalcn" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxpalcnList">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Diagn&oacute;stico Relacionado 1</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxcn1" id="id_dxcn1" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,2);" onblur="fill2();"  size="79" type="text" id="dxcn1"  ondblclick="this.value='';$('#id_dxcn1').val('0')"/>
                                    <div class="suggestionsBox" id="sug_dxcn1" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxcn1List">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td>Diagn&oacute;stico Relacionado 2</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxcn2" id="id_dxcn2" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,3);" onblur="fill3();"  size="79" type="text" id="dxcn2"  ondblclick="this.value='';$('#id_dxcn2').val('0')"/>
                                    <div class="suggestionsBox" id="sug_dxcn2" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxcn2List">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td>Diagn&oacute;stico Relacionado 3</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxcn3" id="id_dxcn3" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,4);" onblur="fill4();"  size="79" type="text" id="dxcn3"  ondblclick="this.value='';$('#id_dxcn3').val('0')"/>
                                    <div class="suggestionsBox" id="sug_dxcn3" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxcn3List">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div><!--FIN DIALOGO RIPS CONSULTAS-->
            </div>

            <!--DIALOGO RIPS PROCEDIMIENTOS-->
            <div id="dialogoParaCapturarRipsProcedimientos" style="display: none" title="RIPS PROCEDIMIENTO">
                <form id="rips-ap">
                    <div id="panelParaCapturarRipsProcedimientos">
                        <input type="hidden" id="iddetalleap" name="iddetalleap" value="0"/>
                        <input type="hidden" id="valorap" name="valorap" value="0"/>
                        <input type="hidden" id="band_ripsap" name="band_ripsap" value="0" />
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>C&oacute;digo</td>
                                <td>Descripci&oacute;n</td>
                            </tr>
                            <tr>
                                <td>
                                    <input size="20" type="text" id="codactripap" name="codactripap" readonly="true"/>
                                </td>

                                <td>
                                    <input size="50" type="text" id="desactripap"  readonly="true"/>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Fecha</td>
                                <td>Autorizacion</td>
                            </tr>
                            <tr>
                                <td>
                                    <input size="20" type="text" id="fecharipap" name="fecharipap"  readonly="true"/>
                                </td>

                                <td>
                                    <input size="50" type="text" id="ordenripap" name="ordenripap" value="0" />
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Finalidad</td>
                                <td>Ambito Procedimiento</td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="text ui-widget-content" id="finalidadap" name="finalidadap" value="0"></select>
                                </td>

                                <td>
                                    <select class="text ui-widget-content" id="ambitoap" name="ambitoap" value="0"></select>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Diagn&oacute;stico</td>
                                <td>Personal Atiende</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxpalap" id="id_dxpalap" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,5);" onblur="fill5();" size="50" type="text" id="dxpalap" ondblclick="this.value='';$('#id_dxpalap').val('')" />
                                    <div class="suggestionsBox" id="sug_dxpalap" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxpalapList">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <select class="text ui-widget-content" id="personalatiendeap" name="personalatiendeap"></select>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Diagn&oacute;stico Relacionado</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxap1" id="id_dxap1" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,6);" onblur="fill6();"  size="70" type="text" id="dxap1"  ondblclick="this.value='';$('#id_dxap1').val('0')"/>
                                    <div class="suggestionsBox" id="sug_dxap1" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxap1List">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td>Complicaci&oacute;n</td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" size="30" name="id_dxapcom" id="id_dxapcom" value="0" class="ui-widget-content" />
                                    <input onkeyup="lookup(this.value,7);" onblur="fill7();"  size="70" type="text" id="dxapcom"  ondblclick="this.value='';$('#id_dxapcom').val('0')"/>
                                    <div class="suggestionsBox" id="sug_dxapcom" style="display: none;">
                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                        <div class="suggestionList" id="sug_dxapcomList">
                                            &nbsp;
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr class="ui-widget-header">
                                <td>Forma Acto Quirurgico</td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="text ui-widget-content" id="formaqxap" name="formaqxap" value="0"></select>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>   
            </div><!--FIN DIALOGO RIPS PROCEDIMIENTOS-->

            <!--DIALOGO RIPS OTROS SERVICIOS-->
            <div id="dialogoParaCapturarRipsOtroServicio" style="display: none" title="RIPS OTROS SERVICIOS">
                <form id="rips-at">
                    <div id="panelParaCapturarRipsOtrosServicios">
                        <input type="hidden" id="iddetalleat" name="iddetalleat" value="0"/>
                        <input type="hidden" id="valorat" name="valorat" value="0"/>
                        <input type="hidden" id="band_ripsat" name="band_ripsat" value="0" />
                        <input type="hidden" id="cantidadat" name="cantidadat" value="0" />
                        <input type="hidden" id="valortotalat" name="valortotalat" value="0" />
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>C&oacute;digo</td>
                                <td>Descripci&oacute;n</td>
                            </tr>
                            <tr>
                                <td>
                                    <input size="20" type="text" id="codactripat" name="codactripat" readonly="true"/>
                                </td>

                                <td>
                                    <input size="50" type="text" id="desactripat"  readonly="true"/>
                                </td>
                            </tr>
                        </table>
                        <table width="100%">
                            <tr class="ui-widget-header">
                                <td>Fecha</td>
                                <td>Autorizacion</td>
                            </tr>
                            <tr>
                                <td>
                                    <input size="20" type="text" id="fecharipat" name="fecharipat"  readonly="true"/>
                                </td>

                                <td>
                                    <input size="50" type="text" id="ordenripat" name="ordenripat" value="0" />
                                </td>
                            </tr>
                        </table>
                        <table width="100%">                                

                            <tr class="ui-widget-header">
                                <td>Tipo de Servicio</td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="text ui-widget-content" id="tiposerat" name="tiposerat" value="0"></select>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>   
            </div><!--FIN DIALOGO RIPS OTROS SERVICIOS-->

            <!--DIALOGO RIPS RECIEN NACIDO-->
            <div id="dialogoParaCapturarRipsRecienNacido" style="display: none" title="RIPS RECIEN NACIDO">                     
                <div id="panelParaCapturarRipsRecienNacido">
                    <table >
                        <tr class="ui-widget-header">
                            <td>Nombre Completo</td>
                            <td colspan="3">
                                <input size="50" type="text" id="nomrn" name="nomrn"/>
                            </td>
                        </tr>
                        <tr class="ui-widget-header">
                            <td width="150px">Fecha Nacimiento</td>
                            <td>
                                <input size="12" type="text" id="fecrn" name="fecrn" value=""/>
                            </td>
                            <td width="150px">Hora Nacimiento</td>
                            <td>
                                <input size="10" type="text" id="horanac" name="horanac" value=""/>
                            </td>
                        </tr>
                        <tr class="ui-widget-header">
                            <td width="150px">Edad Gestacional</td>
                            <td>
                                <input type="text" size="2" id="edadges" name="edadges" value=""/>
                            </td>
                            <td width="150px">Control Prenatal</td>
                            <td>
                                <select id="controlpre" name="controlpre" class="text ui-widget-content">
                                    <option value="1">SI</option>
                                    <option value="2">NO</option>
                                </select>
                            </td>
                        </tr>
                        <tr class="ui-widget-header">
                            <td width="150px">Sexo</td>
                            <td>
                                <select id="idsexo" name="idsexo" class="text ui-widget-content">
                                    <option value="1">MASCULINO</option>
                                    <option value="2">FEMENINO</option>
                                    <option selected="true" value="3">APLICA AMBOS</option>
                                </select>
                            </td>
                            <td width="150px">Peso</td>
                            <td>
                                <input type="text" size="4" id="peso" name="peso" value=""/>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr class="ui-widget-header">
                            <td width="150px">
                                Diagn&oacute;stico RN
                            </td>
                            <td>
                                <input type="hidden" size="30" name="id_dxnac" id="id_dxnac" value="" class="ui-widget-content" />
                                <input onkeyup="lookup(this.value,14);" onblur="fill14();"  size="50" type="text" id="dxnac" value="" />
                                <div class="suggestionsBox" id="sug_dxnac" style="display: none;">
                                    <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                    <div class="suggestionList" id="sug_dxnacList">
                                        &nbsp;
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr class="ui-widget-header">
                            <td width="150px">
                                Diagn&oacute;stico Muerte
                            </td>
                            <td>
                                <input type="hidden" size="30" name="id_dxmu" id="id_dxmu" value="0" class="ui-widget-content" />
                                <input onkeyup="lookup(this.value,15);" onblur="fill15();"  size="50" type="text" id="dxmu" />
                                <div class="suggestionsBox" id="sug_dxmu" style="display: none;">
                                    <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                    <div class="suggestionList" id="sug_dxmuList">
                                        &nbsp;
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <table width="">
                        <tr class="ui-widget-header">
                            <td width="150px">Fecha Muerte</td>
                            <td>
                                <input size="12" type="text" id="fecmu" name="fecmu"/>
                            </td>
                            <td width="150px">Hora Muerte</td>
                            <td>
                                <input size="10" type="text" id="horamu" name="horamu"/>
                            </td>

                        </tr>                                
                    </table>
                </div>
            </div>  <!--FIN DIALOGO RIPS RECIEN NACIDO-->

            <!--DIALOGO RIPS HOSPITALIZACION-->
            <div id="dialogoParaCapturarRipsHospitalizacion" style="display: none" title="RIPS HOSPITALIZACION">
                <div id="tab_estancia_ah" class="tabs-bottom">
                    <ul>
                        <li><a href="#tab_estancia_1_ah">Ingreso</a></li>
                        <li><a href="#tab_estancia_2_ah">Salida</a></li>
                    </ul>
                    <form id="rips-ah">
                        <div id="tab_estancia_1_ah">
                            <table width="100%">
                                <tr class="ui-widget-header">
                                    <td>Fecha / Hora Ingreso</td> 
                                    <td>Via ingreso</td>
                                    <td>Autorizaci&oacute;n N°</td>                                    
                                </tr>
                                <tr>
                                    <td>
                                        <input size="18" type="text" id="fecingah" name="fecingah" class="ui-widget-content"/>                                        
                                    </td>

                                    <!--<td>
                                        <input size="10" type="text" id="horingah" name="horingah" class="ui-widget-content"/>
                                    </td>-->

                                    <td>
                                        <select style="width: 220px" class="text ui-widget-content" id="viaingah" name="viaingah" ></select>
                                    </td>   

                                    <td>
                                        <input size="23" type="text" id="ordripingah" name="ordripingah"/>
                                    </td>                       
                                </tr>
                            </table>
                            <table width="100%">
                                <tr class="ui-widget-header">
                                    <td colspan="3">Causa Externa</td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <select style="width: 435px" class="text ui-widget-content" id="cauextingah" name="cauextingah" ></select>
                                    </td>                                        
                                </tr>                                        
                                <tr class="ui-widget-header">
                                    <td colspan="3">Diagn&oacute;stico Ingreso</td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <input type="hidden" size="30" name="id_dxingah" id="id_dxingah" value="0" class="ui-widget-content" />
                                        <input onkeyup="lookup(this.value,8);" onblur="fill8();"  size="67" type="text" id="dxingah" />
                                        <div class="suggestionsBox" id="sug_dxingah" style="display: none;">
                                            <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                            <div class="suggestionList" id="sug_dxingListah">
                                                &nbsp;
                                            </div>
                                        </div>
                                    </td>                        
                                </tr>
                                <tr class="ui-widget-header">
                                    <td>Pabell&oacute;n</td>
                                    <td>Cuarto</td>                                        
                                    <td>Nro Cama</td>
                                </tr>
                                <tr>
                                    <td>
                                        <select style="width: 210px" class="text ui-widget-content" id="pabelloningah" name="pabelloningah" value="0"></select>
                                    </td>
                                    <td>
                                        <select style="width: 220px" class="text ui-widget-content" id="cuartoingah" name="cuartoingah" value="0"></select>
                                    </td>
                                    <td>
                                        <select style="width: 260px" class="text ui-widget-content" id="camaingah" name="camaingah" value="0"></select>
                                    </td>
                                </tr>   

                                <!--<tr class="ui-widget-header">    
                                    <td colspan="3">Ingresado por</td> 
                                </tr>
                                
                                <tr>
                                    <td colspan="3">
                                        <select style="width: 410px" class="text ui-widget-content" id="responsableingah" name="responsableingah" value="0"></select>
                                    </td>
                                </tr>-->     
                            </table>
                        </div>

                        <div id="tab_estancia_2_ah">

                            <table>

                                <tr>
                                    <td>
                                        <table>

                                            <tr class="ui-widget-header">
                                                <td colspan="2">Fecha / Hora Salida</td>
                                            </tr>

                                            <tr>                                                
                                                <td colspan="2"> <input size="18" type="text" id="fecsalah" name="fecsalah" class="ui-widget-content"/></td>
                                            </tr>

                                            <tr class="ui-widget-header">
                                                <td colspan="2">Diagn&oacute;stico Salida</td>
                                            </tr>

                                            <tr>
                                                <td colspan="2">
                                                    <input type="hidden" size="30" name="id_dxsalah" id="id_dxsalah" value="" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,9);" onblur="fill9();"  size="65" type="text" id="dxsalah" />
                                                    <div class="suggestionsBox" id="sug_dxsalah" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxsalListah">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>             
                                            <tr class="ui-widget-header">
                                                <td>Diagn&oacute;stico Relacionado 1</td>
                                                <td>Diagn&oacute;stico Relacionado 2</td>
                                            </tr>

                                            <tr>
                                                <td>
                                                    <input type="hidden" size="30" name="id_dxrel1ah" id="id_dxrel1ah" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,10);" onblur="fill10();"  size="31" type="text" id="dxrel1ah" />
                                                    <div class="suggestionsBox" id="sug_dxrel1ah" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxrel1Listah">
                                                            &nbsp;
                                                        </div>
                                                    </div>

                                                </td>                                       

                                                <td>
                                                    <input type="hidden" size="30" name="id_dxrel2ah" id="id_dxrel2ah" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,11);" onblur="fill11();"  size="30" type="text" id="dxrel2ah" />
                                                    <div class="suggestionsBox" id="sug_dxrel2ah" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxrel2Listah">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>    
                                            </tr>

                                            <tr class="ui-widget-header">
                                                <td>Diagn&oacute;stico Relacionado 3</td>
                                                <td>Diagn&oacute;stico Complicaci&oacute;n</td>
                                            </tr>

                                            <tr>
                                                <td>
                                                    <input type="hidden" size="30" name="id_dxrel3ah" id="id_dxrel3ah" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,12);" onblur="fill12();"  size="31" type="text" id="dxrel3ah" />
                                                    <div class="suggestionsBox" id="sug_dxrel3ah" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxrel3ahListah">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>

                                                <td>
                                                    <input type="hidden" size="30" name="id_dxcomah" id="id_dxcomah" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,16);" onblur="fill16();"  size="30" type="text" id="dxcomah" />
                                                    <div class="suggestionsBox" id="sug_dxcomah" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxcomahListah">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>

                                            </tr>

                                            <tr class="ui-widget-header">
                                                <td colspan="2">Estado Salida</td>
                                                <!--<td>Causa Muerte</td>-->
                                            </tr>

                                            <tr>
                                                <td colspan="2">
                                                    <select style="width: 340px" class="text ui-widget-content" id="estsalah" name="estsalah" ></select>
                                                </td>
                                                <!--<td>
                                                <select style="width: 200px" class="text ui-widget-content" id="cauextmuesalah" name="cauextmuesalah" ></select> 
                                                </td>-->
                                            </tr>

                                            <tr class="dxmuerte">
                                                <td colspan="2">Diagn&oacute;stico de Muerte</td>
                                            </tr>

                                            <tr class="dxmuerte">
                                                <td colspan="2">
                                                    <input type="hidden" size="30" name="id_dxmuesalah" id="id_dxmuesalah" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,13);" onblur="fill13();"  size="65" type="text" id="dxmuesalah" />
                                                    <div class="suggestionsBox" id="sug_dxmuesalah" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxmuesalahListah">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>  
                                        </table>
                                    </td>  


                                </tr>


                            </table>    

                        </div>
                    </form>
                </div> <!--FIN TABS-->                  
            </div><!--FIN DIALOGO RIPS HOSPITALIZACION-->  

            <!--DIALOGO RIPS URGENCIA-->
            <div id="dialogoParaCapturarRipsUrgencia" style="display: none" title="RIPS URGENCIA">
                <div id="tab_estancia_au" class="tabs-bottom">
                    <ul>
                        <li><a href="#tab_estancia_3_au">Ingreso</a></li>
                        <li><a href="#tab_estancia_4_au">Salida</a></li>
                    </ul>
                    <form id="rips-au">
                        <div id="tab_estancia_3_au">
                            <table width="100%">
                                <tr class="ui-widget-header">
                                    <td>Fecha / Hora Ingreso</td> 
                                    <td>Autorizaci&oacute;n N°</td>                                    
                                </tr>
                                <tr>
                                    <td>
                                        <input size="22" type="text" id="fecingau" name="fecingau" class="ui-widget-content"/>                                        
                                    </td>

                                    <td>
                                        <input size="41" type="text" id="ordripingau" name="ordripingah"/>
                                    </td>                       
                                </tr>
                            </table>
                            <table width="100%">
                                <tr class="ui-widget-header">
                                    <td colspan="3">Causa Externa</td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <select style="width: 255px" class="text ui-widget-content" id="cauextingau" name="cauextingau" ></select>
                                    </td>                                        
                                </tr>                                        

                            </table>
                        </div>

                        <div id="tab_estancia_4_au">
                            <table>
                                <tr>
                                    <td>
                                        <table>

                                            <tr class="ui-widget-header">
                                                <td colspan="2">Fecha / Hora Salida</td>
                                            </tr>

                                            <tr>                                                
                                                <td colspan="2"> <input size="22" type="text" id="fecsalau" name="fecsalau" class="ui-widget-content"/></td>
                                            </tr>

                                            <tr class="ui-widget-header">
                                                <td colspan="2">Diagn&oacute;stico Salida</td>
                                            </tr>

                                            <tr>
                                                <td colspan="2">
                                                    <input type="hidden" size="30" name="id_dxsalau" id="id_dxsalah" value="" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,9);" onblur="fill9();"  size="65" type="text" id="dxsalau" />
                                                    <div class="suggestionsBox" id="sug_dxsalau" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxsalListau">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>             

                                            <tr class="ui-widget-header">
                                                <td>Diagn&oacute;stico Relacionado 1</td>
                                                <td>Diagn&oacute;stico Relacionado 2</td>
                                            </tr>

                                            <tr>
                                                <td>
                                                    <input type="hidden" size="30" name="id_dxrel1au" id="id_dxrel1au" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,10);" onblur="fill10();"  size="30" type="text" id="dxrel1au" />
                                                    <div class="suggestionsBox" id="sug_dxrel1au" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxrel1Listau">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>                                       
                                                <td>
                                                    <input type="hidden" size="30" name="id_dxrel2au" id="id_dxrel2au" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,11);" onblur="fill11();"  size="30" type="text" id="dxrel2au" />
                                                    <div class="suggestionsBox" id="sug_dxrel2au" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxrel2Listau">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>    
                                            </tr>

                                            <tr class="ui-widget-header">
                                                <td >Diagn&oacute;stico Relacionado 3</td>
                                                <td>Destino Salida</td>

                                            </tr>

                                            <tr>
                                                <td>
                                                    <input type="hidden" size="30" name="id_dxrel3au" id="id_dxrel3au" value="0" class="ui-widget-content" />
                                                    <input onkeyup="lookup(this.value,12);" onblur="fill12();"  size="30" type="text" id="dxrel3au" />
                                                    <div class="suggestionsBox" id="sug_dxrel3au" style="display: none;">
                                                        <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                        <div class="suggestionList" id="sug_dxrel3auListau">
                                                            &nbsp;
                                                        </div>
                                                    </div>
                                                </td>             

                                                <td>
                                                    <select style="width: 340px" class="text ui-widget-content" id="destinosalau" name="destinosalau" ></select>
                                                </td>

                                            </tr>

                                            <tr class="ui-widget-header">
                                                <td colspan="2">Estado Salida</td>
                                            </tr>

                                            <tr>
                                                <td colspan="2">
                                                    <select style="width: 340px" class="text ui-widget-content" id="estsalau" name="estsalau" ></select>
                                                </td>

                                            </tr>

                                            <div id="dx_muerte_au">

                                                <tr class="ui-widget-header">
                                                    <td colspan="2">Diagn&oacute;stico de Muerte</td>
                                                </tr>

                                                <tr>
                                                    <td colspan="2">
                                                        <input type="hidden" size="30" name="id_dxmuesalau" id="id_dxmuesalau" value="0" class="ui-widget-content" />
                                                        <input onkeyup="lookup(this.value,13);" onblur="fill13();"  size="65" type="text" id="dxmuesalau" />
                                                        <div class="suggestionsBox" id="sug_dxmuesalau" style="display: none;">
                                                            <img src="../../../../../common/util/imag/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
                                                            <div class="suggestionList" id="sug_dxmuesalauListau">
                                                                &nbsp;
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>  
                                            </div>
                                        </table>
                                    </td> 

                                </tr>
                            </table>    
                        </div>
                    </form>
                </div> <!--FIN TABS-->  
            </div><!--FIN DIALOGO RIPS URGENCIA-->  
        </body>
    </f:view>
</html>
